package com.sfh.cp.base;

import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.sfh.cp.widget.refresh.SwipeRefreshMoreLayout;

/**
 * Created by Administrator on 2018/3/7.
 */

public abstract class RefreshRecyleActivity extends AbstractBaseActivity implements BaseQuickAdapter.OnItemChildClickListener,
        BaseQuickAdapter.OnItemClickListener, SwipeRefreshMoreLayout.OnLoadingListener {

    SwipeRefreshMoreLayout refreshLayout;


    public abstract BaseQuickAdapter createAdapter();


    public void initView(SwipeRefreshMoreLayout refreshLayout, boolean loadMore) {
        this.refreshLayout = refreshLayout;
        this.refreshLayout.setAdapter(createAdapter(), loadMore);
        this.refreshLayout.setOnItemClickListener(this);
        this.refreshLayout.setOnItemChildClickListener(this);
        this.refreshLayout.setOnLoadingListener(this);
        this.refreshLayout.onAutoRefresh();
    }


    @Override
    public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) {

    }

    @Override
    public void onItemClick(BaseQuickAdapter adapter, View view, int position) {

    }

    @Override
    public void onLoadMoreUI() {

    }



}
